.TH ujit 1 "" "" "uJIT documentation"
.SH NAME
ujit \- Just-In-Time Compiler for the Lua Language
\fB
.SH SYNOPSIS
.B ujit
[\fIoptions\fR]... [\fIscript\fR [\fIargs\fR]...]
.SH "WEB SITE"
.IR https://github.com/iponweb/luavela
.SH DESCRIPTION
.PP
This is the command-line program to run Lua programs with \fBuJIT\fR.
.PP
\fBuJIT\fR is a just-in-time (JIT) compiler for the Lua language.
The virtual machine (VM) is based on a fast interpreter combined with
a trace compiler. It can significantly improve the performance of Lua programs.
.PP
\fBuJIT\fR is API\- and ABI-compatible with the VM of the standard
Lua\ 5.1 interpreter. When embedding the VM into an application,
the built library can be used as a drop-in replacement.
.SH OPTIONS
.TP
.BI "\-e " chunk
Run the given chunk of Lua code.
.TP
.BI "\-l " library
Load the named library, just like \fBrequire("\fR\fIlibrary\fR\fB")\fR.
.TP
.BI "\-b " file
List bytecode to \fIfile\fR. Specify \- to list to standard output.
.TP
.BI "\-p " file
Dump compiler's progress to \fIfile\fR. Specify \- to dump to standard output.
.TP
.BI "\-j " command
Perform uJIT control command (optional space after \fB\-j\fR).
.TP
.BI "\-O" [opt]
Control uJIT optimizations.
.TP
.B "\-i"
Run in interactive mode.
.TP
.B "\-v"
Show \fBuJIT\fR version.
.TP
.B "\-E"
Ignore environment variables.
.TP
.B "\-\-"
Stop processing options.
.TP
.B "\-"
Read script from stdin instead.
.PP
After all options are processed, the given \fIscript\fR is run.
The arguments are passed in the global \fIarg\fR table.
.PP
Interactive mode is only entered, if no \fIscript\fR and no \fB\-e\fR
option is given. Interactive mode can be left with EOF (\fICtrl\-Z\fB).
.SH EXAMPLES
.TP
ujit hello.lua world

Prints "Hello world", assuming \fIhello.lua\fR contains:
.br
  print("Hello", arg[1])
.TP
ujit \-e "local x=0; for i=1,1e9 do x=x+i end; print(x)"

Calculates the sum of the numbers from 1 to 1000000000.
.br
And finishes in a reasonable amount of time, too.
.TP
ujit \-p\- \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end"

Runs some nested loops and shows the resulting traces.
.SH COPYRIGHT
.PP
\fBuJIT\fR is Copyright \(co 2015-2019 IPONWEB Ltd.
.SH SEE ALSO
More about the Lua language can be found at:
.IR http://lua.org/docs.html
.PP
lua(1)
